﻿using System.Collections.Generic;

namespace IceCS.DesignPattern.Core.MementoPattern.RollBack
{
    /// <summary>
    /// 管理人
    /// </summary>
    public class CareTaker
    {
        private readonly List<Memento> _mementoList = new List<Memento>();

        public void AddMemento(Memento state) => _mementoList.Add(state);

        public Memento GetMemento(int index) => _mementoList[index];
    }
}
